<extend name="Base/common"/>

<block name="style">
<link href="__CSS__/stylesheet.css" rel="stylesheet">
<link href="__CSS__/user.css" rel="stylesheet">
<style>
.iamgesbox{padding:5px 0}
.iamgesbox img{margin-right:5px; width:80px;height:80px}
</style>
</block>

<block name="header">
<header>
	<include file="User/header" />
</header>
</block>

<block name="body">
<div class="container main">
	<div class="user-main">
		<div class="col-xs-3">
			<include file="User/left_menu" />
		</div>
		<div class="col-xs-9">
			<h5>退款</h5>
			<div class="content">
				<form action="{:U('AjaxAction/applyforReturn')}" method="post" class="form-horizontal" enctype="multipart/form-data">
					<div class="form-group">
						<label class="col-xs-2 label-control">退款原因：</label>
						<div class="col-xs-8">
							<select class="form-control" name="reason">
								<option value="0">主角选择退款原因</option>
								<option value="态度问题">态度问题</option>
								<option value="商品问题">商品问题</option>
								<option value="物流问题">物流问题</option>
							</select>
						</div>
					</div>
					<div class="form-group">
						<label class="col-xs-2 label-control">退款金额：</label>
						<div class="col-xs-8">
							<input type="text" name="money" value="" class="form-control">
						</div>
					</div>
					<div class="form-group">
						<label class="col-xs-2 label-control">退款说明：</label>
						<div class="col-xs-8">
							<textarea rows="6" class="form-control" name="explain"></textarea>
						</div>
					</div>
					<div class="form-group">
						<label class="col-xs-2 label-control">上传凭证：</label>
						<div class="col-xs-8">
							<a class="btn upload"  id="file_img" href="javascript:;">+</a>
						</div>
						
					</div>
					<div class="form-group">
					<label class="col-xs-2 "></label>
					<div class="col-xs-8 iamgesbox">
						</div>
					</div>
					<div class="form-group" style="margin-top: 40px !important;">
						<label class="col-xs-2 label-control"></label>
						<div class="col-xs-8">
							<input type="hidden" name="type" value="1" />
							<input type="hidden" name="orderid" value="{$info.id}" />
							<button type="submit" class="btn ajax-post"  target-form="form-horizontal">提交</button>
						</div>
					</div>
				</form>
			</div>
		</div>
	</div>
</div>
</block>

<block name="script">
<script type="text/javascript" src="__STATIC__/uploadify/jquery.uploadify.min.js"></script>					
<script type="text/javascript">
//上传图片
/* 初始化上传插件 */
$("#file_img").uploadify({      
	  "height"          : 80,
      "swf"             : "__STATIC__/uploadify/uploadify.swf",
      "fileObjName"     : "download",
      "buttonText"      : "+",
      "buttonClass"		: "upload",
      "uploader"        : "{:U('File/uploadPicture',array('session_id'=>session_id()))}",
      "width"           : 80,
      'removeTimeout'	  : 1,
      'fileTypeExts'	  : '*.jpg; *.png; *.gif;',
      "onUploadSuccess" : uploadPicture_panel,
      'onFallback' : function() {
          alert('未检测到兼容版本的Flash.');
      }
});
function uploadPicture_panel(file, data){
   	var data = $.parseJSON(data);
   	src = data.url || "__ROOT__" + data.path;
       if(data.status){
       	$(".iamgesbox").append(
       			"<input type=\"hidden\" name=\"cover_id[]\" value=\""+data.id+"\" />"+
       			"<a><img src=\""+src+"\"/></a>"
 			);
       } else {
       	updateAlert(data.info);
       	setTimeout(function(){
               $('#top-alert').find('button').click();
               $(that).removeClass('disabled').prop('disabled',false);
           },1500);
       }
}
highlight_leftnav("{:U('User/orders',array('type'=>$type))}");
highlight_subnav("{:U('User/index')}");
</script>
</block>